import {userRequest} from '@/utils/request'

/**
 * 用户注册
 * @param {*} param0 
 * @returns 
 */
export const userRegister = ({ username, password,role }) =>
    userRequest.post('/user/reg',{username,password,role})


/**
 * 用户登录
 * @param {*} param0 
 * @returns 
 */
export const userLogin = ({ username, password }) =>
    userRequest.post('/user/login',{username,password})

/**
 * 获取用户信息
 * @param {*} param0 
 * @returns 
 */
export const userInfo = ({ pageNum, pageSize }) =>
    userRequest.get('/user/getUserInfolist', {
        params: { pageNum, pageSize }
    });

/**
 * 删除用户
 * @param {*} param0 
 * @returns 
 */
export const deleteUser = (userId) =>
    userRequest.delete('/user/deleteUserInfo', {
        params: { userId }
    });
